home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
U-Utilities
/
(c)u1.d64
/
64 renumber.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
393b
|
18 lines
30000 REM*30000* RENUMBER RTN
30005 X=2049:Y=10:IN=10
30010 X1=PEEK(X+4):X2=PEEK(X+5)
30020 IF X1<>143 OR X2<>42 GOTO 30100
30030 X1=X+6:X2=0
30040 X3=PEEK(X1)
30050 IF X3=42 THEN 30090
30060 X3=X3-48
30070 IF X3<0 OR X3>9 THEN PRINT "ERR1":GOTO 30100
30080 X2=X2*10+X3:X1=X1+1:GOTO 30040
30090 IF Y<X2 THEN Y=X2:IN=10
30100 Y2=INT(Y/256):Y1=Y-Y2*256
30110 POKE X+2,Y1:POKE X+3,Y2:Y=Y+IN
30120 X=PEEK(X)+256*PEEK(X+1)
30130 Z=PEEK(X+2)+256*PEEK(X+3)
30140 IF Z<30000 THEN 30010
30150 END